package temp

//
//import (
//	"black_mamba/workers/amazon"
//)
//
//type BDCheckoutWorker struct {
//	Worker
//}
//
//func NewBDCheckoutWorker() *BDCheckoutWorker {
//	return &BDCheckoutWorker{}
//}
//
//func (b *BDCheckoutWorker) Execute(data map[string]interface{}) {
//	/*
//	   流程
//	    1.访问首页
//		2.修改地址
//		3.打开Listing
//		4.加入购物车
//		5.结账
//		6.创建地址
//		7.获取信用卡表单
//		8.创建信用卡
//		9.建立订单
//	*/
//	//var logData map[string]string
//	//url :=  data["url"].(string)
//	//asin :=  data["asin"].(string)
//
//	amz := amazon.NewAmazon()
//
//	//设置base url
//	amz.SetBaseUrl("https://www.amazon.com")
//
//	//打开首页
//	resp, document, _ := amz.Navigate("/")
//
//	//提取首页token
//	//token := amz.ExtractCsrfToken(document)
//	//
//	////提取地址token
//	//resp, document, _ = amz.AddressSelection(token)
//	//
//	////改变发货地址
//	//_ = amz.ChangeAddress(resp.String())
//
//	resp, document, _ = amz.Navigate("/a/addresses/add?ref=ya_address_book_add_button")
//
//	if amz.IsNeedLogin(resp.RawResponse.Request.URL.String()) {
//		//document, _ = amz.Login("jacquet07609d0176@foxemail.club", "jacquet Philips", "09136d821a", document)
//		//document, _ = amz.Login("b920e91273e9f10@foxemail.club", "jacquet Philips", "ufeyamhq", document)
//		resp, document, _ = amz.Login("d5432d34f3b3dc@hetmail.club", "jacquet Philips", "kbhmjzos", document)
//	}
//
//	if amz.IsNeedAccountFixup(resp.RawResponse.Request.URL.String()) {
//		document, _ = amz.AccountFixup(document)
//	}
//
//	_, document, _ = amz.AddShippingAddress(document)
//
//	_, document, _ = amz.Navigate(`/cpe/yourpayments/wallet?ref_=ya_d_l_pmt_mpo#`)
//
//
//	document, _ = amz.GetCreditCardForm(document)
//	document, _ = amz.CreateCreditCard(document)
//	document, _ = amz.SetDefaultCreditCard(document)
//
//	// 打开Listing
//	_, document, _ = amz.Navigate(`/gp/product/B09T6VK8DP/ref=ox_sc_act_title_1?smid=A2YMF5K3MGHJNL&psc=1`)
//
//	// 提取listing表单
//	//action, method, cartFormData := amz.ExtractFormData(document,"#addToCart")
//	//delete(cartFormData, "gift-wrap")
//	//
//	//// 加入购物车
//	//resp, _, _ := amz.Submit(action, method, cartFormData)
//	_, _ = amz.AddCart(document)
//
//	// 打开购物车页面
//	_, document, _ = amz.Navigate(`/gp/cart/view.html?ref_=nav_cart`)
//
//	// 提取表单
//	//action, method, queryData := amz.ExtractFormData(document,"#gutterCartViewForm")
//	//
//	//queryData["cartInitiateId"] = strconv.Itoa(int(time.Now().UnixNano() / 1e6))
//	//queryData["isToBeGiftWrapped"] = "0"
//	//queryData["isToBeGiftWrappedBefore"] = "0"
//	//
//	//// 开始下单
//	//resp, document, _ = amz.Submit(action, method, queryData)
//	document, _ = amz.Checkout(document)
//
//	// 提取收货地址
//	//_, method, shippingFormData := amz.ExtractFormData(document, "#address-ui-checkout-form")
//	//
//	//purchaseId, _ := document.Find("input[name='purchaseId']").Attr("value")
//	//
//	//shippingFormData["purchaseId"] = purchaseId
//	//shippingFormData["address-ui-widgets-countryCode"] = "US"
//	//shippingFormData["address-ui-widgets-enterAddressFullName"] = "valentin Parge"
//	//shippingFormData["address-ui-widgets-enterAddressPhoneNumber"] = "909 772 9182"
//	//shippingFormData["address-ui-widgets-enterAddressLine1"] = "6269 Davidson St"
//	//shippingFormData["address-ui-widgets-enterAddressLine2"] = ""
//	//shippingFormData["address-ui-widgets-enterAddressCity"] = "Chino"
//	//shippingFormData["address-ui-widgets-enterAddressStateOrRegion"] = "CA"
//	//shippingFormData["address-ui-widgets-enterAddressPostalCode"] = "91710"
//	//
//	//// 创建地址
//	//resp, document, _ = amz.Submit(`https://www.amazon.com/a/addresses/ajax/widgets/create`, method, shippingFormData)
//	//addressId := gjson.Get(resp.String(), "createOrEditAddressResponse.addressId").String()
//	document, _ = amz.CreateShippingAddress(document)
//
//	// 下一步
//	//_, document, _ = amz.Submit(`https://www.amazon.com/gp/buy/shared/handlers/async-continue.html/ref=ox_shipaddress_add_new_addr`, amazon.POST, map[string]string{
//	//	"action": "select-shipping",
//	//	"addressID": addressId,
//	//	"purchaseId": purchaseId,
//	//	"isClientTimeBased": "1",
//	//	"handler": "/gp/buy/addressselect/handlers/continue.html",
//	//})
//
//	// 获取付款方式表单
//	//widgetState, _ :=  document.Find("input[name='ppw-widgetState']").Attr("value")
//	//paymentInfo := map[string]string{
//	//	"widgetState": widgetState,
//	//	"returnUrl":"/gp/buy/payselect/handlers/apx-submit-continue.html",
//	//	"clientId":"Checkout",
//	//	"usePopover":"true",
//	//	"maxAgeSeconds":"7200",
//	//	"iFrameName":"ApxSecureIframe-pp-wvoTLo-7",
//	//	"parentWidgetInstanceId":"bSmJ3eEN39o4",
//	//	"hideAddPaymentInstrumentHeader":"true",
//	//	"creatablePaymentMethods":"CC",
//	//}
//	//
//	//resp, document, _ = amz.Submit(`https://apx-security.amazon.com/cpe/pm/register`, amazon.POST, paymentInfo)
//	document, _ = amz.GetCreditCardForm(document)
//
//	// 提交信用卡信息
//	//action, method, paymentFormData := amz.ExtractFormData(document, "form[id^='pp-']")
//	//
//	//paymentFormData["addCreditCardNumber"] = "5165804436344829"
//	//paymentFormData["ppw-accountHolderName"] = "Carolyn Tingle"
//	//paymentFormData["ppw-expirationDate_month"] = "05"
//	//paymentFormData["ppw-expirationDate_year"] = "2026"
//	//
//	//action = `https://apx-security.amazon.com/payments-portal/data/f1/widgets2/v1/customer/A2RDKFKT32O8RZ/continueWidget?sif_profile=APX-Encrypt-All-NA`
//	//resp, _, _ = amz.Submit(action, method, paymentFormData)
//	document, _ = amz.CreateCreditCard(document)
//
//	_, document, _ = amz.Navigate(`gp/buy/payselect/handlers/display.html?hasWorkingJavascript=1`)
//	document, _ = amz.SetPaymentMethod(document)
//
//	//html, _ := document.Html()
//	//ioutil.WriteFile("amazon_test.html", []byte(html), 0644)
//	//完成订单
//	//action, method, placeOrderFormData := amz.ExtractFormData(document, "#spc-form")
//	//resp, _, _ = amz.Submit(action, method, placeOrderFormData)
//	//_, _ = amz.PlaceOrder(document)
//
//	//ioutil.WriteFile("amazon_test.html", resp.Body(), 0644)
//	//resp, document, _ = amz.Navigate("https://www.amazon.com/ap/register?openid.pape.max_auth_age=0&openid.return_to=https%3A%2F%2Fwww.amazon.com%2Fref%3Dap_frn_logo%2F%3F_encoding%3DUTF8%26ref_%3Dnav_newcust&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.assoc_handle=usflex&openid.mode=checkid_setup&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&")
//	//
//	//action, registerFormData := amz.ExtractFormData(document, "#ap_register_form")
//	//registerFormData["customerName"] = "wengo"
//	//registerFormData["email"] = "39871194311@gmail.com"
//	//registerFormData["password"] = "123456789"
//	//registerFormData["passwordCheck"] = "123456789"
//	//registerFormData["metadata1"] = "ECdITeCs:zhiBZALqGIjHB3XiwI90bCyu3jJNc/1tJu5qNbaULK7/DAsi4xzKmWx/MxR+UK2Sg1L5dWChaZFjBHloyOgmOIU+F9nAkxxW9KxknnGvGW2Yyn1yePq8fAQDSZo2zzGbMz59p6kYd4rvSIt8xn0PuZuyThKJv3A1+8FTTUcOg73xkcZWwlbWiAD5buAZfhJWg8cnZR8ZoAdwJL37110NSp/3WvwygDvObV8Vkj8gMAP43N69Ru3RtD/Tj35GishvxoUXJ1h9cQLN+UhSMRPtOhiW+mv79isYV5vBcl6U5YDQlHiHViQs+T95pWMEJW7tDLFrDZBrjonHTP0OHeSqQv9uujLbR5RM7hY3/aY+4MqmhI/yPyNTHMAQurSD5nfjphSi8h5w5LxqJVHEvWOPsxdVPXIeFhINPdBgNgnW0wyMwplA7wsqAZsV/7PKJEpxDtM4STvbSNaapPHHtAXvc5fSX1OAM1/5VCjuIUNM9wT0MkyZH2qHlPiNsev/mZc5UBB1u7GEK5OqPa7T+0hNdsWiGeCR/w0oLd27xx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cOssqUI59sbvXp36pyDCDytkP9BHt+1tFrjHpyc6h+JJcjYbbTcUTXXI79wX51QCFk2RkE0zmVvc0RistjrcvenIwjNXU+10U4V9qMwu4BtA+So1NoEhILEKtc8du9CW11Xubt3J76HdZgx7JQYjhBAL+XLrY+VtoBPn3gTw/iFyzdn1r2aoe6u/JQJ2n35qbIh6N2PBt1/s4xT3ydkLflzvJmFpN4rC+qWLhowvCIvWXXBreM4oSioLzNH0HG1zL/fzcjUkHEzwS1QvuFVfYyqFaVSMV6z7LoIiAfrG0r1YGfng+nO4zQBlAVlNzTrWgiZS2bBha2YfUZ4W+STX5Y3XkaAcjYESy8/lh4P2sYXT1lya/5zlg2e6FLV+pUQdrv0cuMl4GKRBzi03m6St1Rtca3DG5CecMwohYHI39WysS+QbdIgFLYSh4xIz3nVbnHFYVPhO4LoeMWimDfJt1vnGqt7x9ThndgQRe/1I6SMQLyqaoMacSIrId/4OM0yivGG0wey/T8WpYLn/nMZfIGcWzXkNZjwZq9DaDS0Aimexj4W2P7Ihd5Y1znm+3QlNK960vI0fe7+39jjuHl2gktVbVtC5VHJfJMwjc1EHrp/7eaKBBlmqX98PuNDawfjIhM2SS+9iFzHvXFAjDYZVOscsIb9nJBf/LtAUVf2590/VqwsQyZgmZT00B+SZgKzTozem7aJbUq2N8LMUXr23deAXmKUS7+aYyIJpVe/QgDLIWivLrSLjhlvHeSfjbk8g6Gkl2aOclz6vZD5DeFL3ojWG0VK7MUm1ey1D9BSs1v/YmckIo/VrvszI0gUhA8cdzwcrMGWzPofIG2tcSJjYm1kcTTpdX7DXOj/xsRh5CyCKXbFbJEAjn2RMPKjsc+AqX+WWXDBUfDb7eVF07iauXIBx547BYbLodJmoehJQLYK/nAauc0HjjHyMG+a71YCCYeOujWEQ8Vwbpz6r32KZt5CPl6LqBcMnK+RHSyQ=="
//	//
//	//resp, document, _ = amz.Submit(action, registerFormData)
//	//fmt.Println(resp.Header().Get("Location"))
//	//ioutil.WriteFile("register.html", resp.Body(), 0644)
//
//
//
//	//if !amz.CheckListingAvailable(document) {
//	//	b.sendLog(map[string]string{"status": "error", "content": fmt.Sprintf("%s 产品不可售", asin)})
//	//} else {
//	//	// 提取加购表单
//	//	action, formData := amz.ExtractFormData(document)
//	//
//	//	formData["quantity"] = strconv.Itoa(99999)
//	//	lastStock := 0
//	//	for ;; {
//	//		// 加购
//	//		document, _ = amz.AddCart(action, nil, formData)
//	//
//	//		// 获取库存
//	//		stock := amz.GetStock(document)
//	//		if stock["status"] == "success" {
//	//			if lastStock == 0 {
//	//				lastStock, _ = strconv.Atoi(stock["qty"])
//	//				b.sendLog(map[string]string{"status": "info", "content": fmt.Sprintf("%s 原始库存为: %d 个", asin, lastStock)})
//	//			} else {
//	//				currentStock, _ := strconv.Atoi(stock["qty"])
//	//
//	//				if lastStock - currentStock == 0 {
//	//					b.sendLog(map[string]string{"status": "info", "content": fmt.Sprintf("%s 库存无变化", asin)})
//	//				} else {
//	//					lastStock = lastStock - currentStock
//	//					b.sendLog(map[string]string{"status": "success", "content": fmt.Sprintf("%s -> 当前库存为 %d, 库存有变化: %d", asin, currentStock, lastStock)})
//	//				}
//	//			}
//	//		} else {
//	//			b.sendLog(map[string]string{"status": "error", "content": fmt.Sprintf("查询库存错误，原因 = %s", stock["reason"])})
//	//		}
//	//
//	//		time.Sleep(10 * time.Second)
//	//	}
//	//}
//
//	*/
//
//}
